#include<func.h>
int main(void)
{
    //匿名管道 读阻塞
    int fds[2];
    pipe(fds);
    if(fork())
    {
        //父进程  父进程写
        close(fds[0]);
        //对管道进行读
        write(fds[1],"helloworld\n",12);
        close(fds[1]);
        wait(NULL);

    }
    else
    {
        //子进程 子进程读
        close(fds[1]);
        char buf[4096] ={0}; 
        read(fds[0],buf,sizeof(buf));
        printf("parrent buf = %s\n",buf);
        close(fds[0]);
    }

    
}